<!-- 外部跳转 -->
<template>
    <div class="iframePage" v-loading2="loading">
        <iframe ref="Iframe" :src="src" frameborder="0" style="width: 100%; height: 100%"></iframe>
    </div>
</template>
  
<script>
// import { win } from "@/background.js";
export default {
    components: {},
    data() {
        return {
            src: "http://localhost:10086/#/dataAnalyse",
            token: "",
            loading: false,
        };
    },

    computed: {},
    watch: {},
    beforeDestroy() {
        this.loading = false;
    },
    mounted() {
        this.iframeLoad();
        // this.getToken();
    },

    methods: {
        iframeLoad() {
            this.loading = true;
            const iframe = this.$refs.Iframe;
            if (iframe.attachEvent) {
                // IE
                iframe.attachEvent("onload", () => {
                    this.loading = false;
                });
            } else {
                // 非IE
                iframe.onload = () => {
                    this.loading = false;
                };
            }
        },
        getToken() {
            this.token = JSON.parse(localStorage.getItem("pro__Access-Token")).value;
            console.log(this.token);
        },
    },
};
</script>
<style lang="less" scoped>
.iframePage {
    width: 100%;
    height: 100%;
}
</style>
  